import axios from "axios";
var chart_569658cffb59492e893aa8e5ce698502 = echarts.init(
    document.getElementById('569658cffb59492e893aa8e5ce698502'), 'white', { renderer: 'canvas' });
var option_569658cffb59492e893aa8e5ce698502 = {
    "animation": true,
    "animationThreshold": 2000,
    "animationDuration": 1000,
    "animationEasing": "cubicOut",
    "animationDelay": 0,
    "animationDurationUpdate": 300,
    "animationEasingUpdate": "cubicOut",
    "animationDelayUpdate": 0,
    "color": [
        "#c23531",
        "#2f4554",
        "#61a0a8",
        "#d48265",
        "#749f83",
        "#ca8622",
        "#bda29a",
        "#6e7074",
        "#546570",
        "#c4ccd3",
        "#f05b72",
        "#ef5b9c",
        "#f47920",
        "#905a3d",
        "#fab27b",
        "#2a5caa",
        "#444693",
        "#726930",
        "#b2d235",
        "#6d8346",
        "#ac6767",
        "#1d953f",
        "#6950a1",
        "#918597"
    ],
    "series": [
        {
            "type": "bar",
            "name": "mean",
            "legendHoverLink": true,
            "data": [
                22.02,
                21.33,
                18.0,
                15.09,
                13.67,
                13.0,
                13.0,
                13.0,
                12.11,
                11.67,
                11.38,
                11.11,
                11.0,
                11.0,
                11.0,
                10.83,
                10.75,
                10.0,
                10.0,
                10.0,
                10.0,
                10.0,
                10.0,
                9.5,
                9.25,
                9.0,
                9.0,
                9.0,
                9.0,
                8.33,
                8.25,
                8.0,
                8.0,
                8.0,
                8.0,
                7.5,
                7.0,
                7.0,
                7.0,
                6.0,
                6.0,
                6.0,
                6.0,
                6.0,
                6.0,
                5.0,
                5.0,
                4.0,
                4.0,
                4.0,
                4.0,
                3.5
            ],
            "showBackground": false,
            "barMinHeight": 0,
            "barCategoryGap": "40%",
            "barGap": "30%",
            "large": false,
            "largeThreshold": 400,
            "seriesLayoutBy": "column",
            "datasetIndex": 0,
            "clip": true,
            "zlevel": 0,
            "z": 2,
            "label": {
                "show": false,
                "position": "top",
                "margin": 8
            },
            "itemStyle": {
                "normal": {
                    "color": "#ffff"
                }
            }
        },
        {
            "type": "line",
            "name": "max",
            "connectNulls": false,
            "symbolSize": 4,
            "showSymbol": true,
            "smooth": false,
            "clip": true,
            "step": false,
            "data": [
                [
                    "\u5317\u4eac",
                    60.0
                ],
                [
                    "\u4e0a\u6d77",
                    60.0
                ],
                [
                    "\u676d\u5dde",
                    35.0
                ],
                [
                    "\u6df1\u5733",
                    30.0
                ],
                [
                    "\u5357\u4eac",
                    20.0
                ],
                [
                    "\u897f\u5b89",
                    20.0
                ],
                [
                    "\u4fdd\u5b9a",
                    13.0
                ],
                [
                    "\u82cf\u5dde",
                    20.0
                ],
                [
                    "\u5e7f\u5dde",
                    20.0
                ],
                [
                    "\u4e1c\u839e",
                    15.0
                ],
                [
                    "\u6210\u90fd",
                    20.0
                ],
                [
                    "\u53a6\u95e8",
                    15.0
                ],
                [
                    "\u829c\u6e56",
                    11.0
                ],
                [
                    "\u4f5b\u5c71",
                    15.0
                ],
                [
                    "\u65e0\u9521",
                    11.0
                ],
                [
                    "\u957f\u6c99",
                    15.0
                ],
                [
                    "\u5408\u80a5",
                    14.0
                ],
                [
                    "\u9a6c\u978d\u5c71",
                    10.0
                ],
                [
                    "\u54b8\u9633",
                    10.0
                ],
                [
                    "\u957f\u6625",
                    10.0
                ],
                [
                    "\u6b66\u6c49",
                    15.0
                ],
                [
                    "\u4e2d\u5c71",
                    10.0
                ],
                [
                    "\u60e0\u5dde",
                    10.0
                ],
                [
                    "\u798f\u5dde",
                    12.0
                ],
                [
                    "\u90d1\u5dde",
                    15.0
                ],
                [
                    "\u54c8\u5c14\u6ee8",
                    10.0
                ],
                [
                    "\u6c5f\u95e8",
                    9.0
                ],
                [
                    "\u6e05\u8fdc",
                    9.0
                ],
                [
                    "\u77f3\u5bb6\u5e84",
                    9.0
                ],
                [
                    "\u5357\u5b81",
                    10.0
                ],
                [
                    "\u592a\u539f",
                    13.0
                ],
                [
                    "\u5927\u8fde",
                    11.0
                ],
                [
                    "\u6c88\u9633",
                    10.0
                ],
                [
                    "\u6d4e\u5357",
                    12.0
                ],
                [
                    "\u6dc4\u535a",
                    8.0
                ],
                [
                    "\u5929\u6d25",
                    11.0
                ],
                [
                    "\u821f\u5c71",
                    7.0
                ],
                [
                    "\u9752\u5c9b",
                    7.0
                ],
                [
                    "\u4e34\u6c82",
                    7.0
                ],
                [
                    "\u8302\u540d",
                    6.0
                ],
                [
                    "\u4e09\u4e9a",
                    6.0
                ],
                [
                    "\u6e56\u5dde",
                    6.0
                ],
                [
                    "\u6606\u660e",
                    6.0
                ],
                [
                    "\u5b81\u6ce2",
                    6.0
                ],
                [
                    "\u535a\u5c14\u5854\u62c9\u8499\u53e4\u81ea\u6cbb\u5dde",
                    6.0
                ],
                [
                    "\u5b9c\u6625",
                    5.0
                ],
                [
                    "\u4e91\u6d6e",
                    5.0
                ],
                [
                    "\u5609\u5174",
                    4.0
                ],
                [
                    "\u91cd\u5e86",
                    4.0
                ],
                [
                    "\u94f6\u5ddd",
                    4.0
                ],
                [
                    "\u627f\u5fb7",
                    4.0
                ],
                [
                    "\u547c\u548c\u6d69\u7279",
                    6.0
                ]
            ],
            "hoverAnimation": true,
            "label": {
                "show": true,
                "position": "top",
                "margin": 8
            },
            "lineStyle": {
                "show": true,
                "width": 1,
                "opacity": 1,
                "curveness": 0,
                "type": "solid"
            },
            "areaStyle": {
                "opacity": 0
            },
            "zlevel": 0,
            "z": 0
        }
    ],
    "legend": [
        {
            "data": [
                "mean",
                "max"
            ],
            "selected": {
                "mean": true,
                "max": true
            },
            "show": true,
            "right": "5%",
            "padding": 5,
            "itemGap": 10,
            "itemWidth": 25,
            "itemHeight": 14,
            "textStyle": {
                "color": "#d4d4d4"
            }
        }
    ],
    "tooltip": {
        "show": true,
        "trigger": "item",
        "triggerOn": "mousemove|click",
        "axisPointer": {
            "type": "line"
        },
        "showContent": true,
        "alwaysShowContent": false,
        "showDelay": 0,
        "hideDelay": 100,
        "textStyle": {
            "fontSize": 14
        },
        "borderWidth": 0,
        "padding": 5
    },
    "xAxis": [
        {
            "show": true,
            "scale": false,
            "nameLocation": "end",
            "nameGap": 15,
            "gridIndex": 0,
            "axisLine": {
                "show": true,
                "onZero": true,
                "onZeroAxisIndex": 0,
                "lineStyle": {
                    "show": true,
                    "width": 2,
                    "opacity": 1,
                    "curveness": 0,
                    "type": "solid",
                    "color": "#d4d4d4"
                }
            },
            "axisLabel": {
                "show": true,
                "position": "top",
                "color": "#d4d4d4",
                "margin": 10
            },
            "inverse": false,
            "offset": 0,
            "splitNumber": 5,
            "minInterval": 0,
            "splitLine": {
                "show": false,
                "lineStyle": {
                    "show": true,
                    "width": 1,
                    "opacity": 1,
                    "curveness": 0,
                    "type": "solid"
                }
            },
            "data": [
                "\u5317\u4eac",
                "\u4e0a\u6d77",
                "\u676d\u5dde",
                "\u6df1\u5733",
                "\u5357\u4eac",
                "\u897f\u5b89",
                "\u4fdd\u5b9a",
                "\u82cf\u5dde",
                "\u5e7f\u5dde",
                "\u4e1c\u839e",
                "\u6210\u90fd",
                "\u53a6\u95e8",
                "\u829c\u6e56",
                "\u4f5b\u5c71",
                "\u65e0\u9521",
                "\u957f\u6c99",
                "\u5408\u80a5",
                "\u9a6c\u978d\u5c71",
                "\u54b8\u9633",
                "\u957f\u6625",
                "\u6b66\u6c49",
                "\u4e2d\u5c71",
                "\u60e0\u5dde",
                "\u798f\u5dde",
                "\u90d1\u5dde",
                "\u54c8\u5c14\u6ee8",
                "\u6c5f\u95e8",
                "\u6e05\u8fdc",
                "\u77f3\u5bb6\u5e84",
                "\u5357\u5b81",
                "\u592a\u539f",
                "\u5927\u8fde",
                "\u6c88\u9633",
                "\u6d4e\u5357",
                "\u6dc4\u535a",
                "\u5929\u6d25",
                "\u821f\u5c71",
                "\u9752\u5c9b",
                "\u4e34\u6c82",
                "\u8302\u540d",
                "\u4e09\u4e9a",
                "\u6e56\u5dde",
                "\u6606\u660e",
                "\u5b81\u6ce2",
                "\u535a\u5c14\u5854\u62c9\u8499\u53e4\u81ea\u6cbb\u5dde",
                "\u5b9c\u6625",
                "\u4e91\u6d6e",
                "\u5609\u5174",
                "\u91cd\u5e86",
                "\u94f6\u5ddd",
                "\u627f\u5fb7",
                "\u547c\u548c\u6d69\u7279"
            ]
        }
    ],
    "yAxis": [
        {
            "show": true,
            "scale": false,
            "nameLocation": "end",
            "nameGap": 15,
            "gridIndex": 0,
            "axisLine": {
                "show": false,
                "onZero": true,
                "onZeroAxisIndex": 0,
                "lineStyle": {
                    "show": true,
                    "width": 2,
                    "opacity": 1,
                    "curveness": 0,
                    "type": "solid",
                    "color": "#d4d4d4"
                }
            },
            "axisTick": {
                "show": false,
                "alignWithLabel": false,
                "inside": false
            },
            "axisLabel": {
                "show": true,
                "position": "top",
                "color": "#d4d4d4",
                "margin": 10,
                "formatter": "{value} K"
            },
            "inverse": false,
            "offset": 0,
            "splitNumber": 5,
            "minInterval": 0,
            "splitLine": {
                "show": true,
                "lineStyle": {
                    "show": true,
                    "width": 1,
                    "opacity": 1,
                    "curveness": 0,
                    "type": "solid"
                }
            }
        }
    ],
    "title": [
        {
            "text": "\u00b7\u5404\u57ce\u5e02\u57fa\u672c\u5de5\u8d44\u60c5\u51b5",
            "top": 5,
            "padding": 5,
            "itemGap": 10,
            "textStyle": {
                "color": "#d4d4d4",
                "fontWeight": "normal",
                "fontFamily": "\u534e\u6587\u7ec6\u9ed1",
                "fontSize": 18
            }
        }
    ],
    "visualMap": {
        "show": false,
        "type": "continuous",
        "min": 0,
        "max": 20,
        "inRange": {
            "color": [
                "#3d81a0",
                "#00FFFF"
            ]
        },
        "calculable": true,
        "inverse": false,
        "splitNumber": 5,
        "orient": "vertical",
        "showLabel": true,
        "itemWidth": 20,
        "itemHeight": 140,
        "borderWidth": 0
    },
    "dataZoom": {
        "show": true,
        "type": "slider",
        "realtime": true,
        "start": 0,
        "end": 15,
        "orient": "horizontal",
        "zoomLock": false,
        "filterMode": "filter"
    },
    "grid": [
        {
            "show": false,
            "zlevel": 0,
            "z": 2,
            "right": "5%",
            "containLabel": false,
            "backgroundColor": "transparent",
            "borderColor": "#ccc",
            "borderWidth": 1
        }
    ]
};
chart_569658cffb59492e893aa8e5ce698502.setOption(option_569658cffb59492e893aa8e5ce698502);
window.addEventListener('resize', function () {
    chart_569658cffb59492e893aa8e5ce698502.resize();
})
export const updateSalaryBar = (city) => {
    axios
        .get(city + '/districtCount')
        .then(function (response) {
            var names = []
            var values = []
            for(var itme of response.data){
                names.push(itme.name)
                values.push(itme.value)
            }
            option_569658cffb59492e893aa8e5ce698502.series[0].data = values
            option_569658cffb59492e893aa8e5ce698502.series[0].name = ""
            option_569658cffb59492e893aa8e5ce698502.series[1].name = ""
            option_569658cffb59492e893aa8e5ce698502.xAxis[0].data = names
            option_569658cffb59492e893aa8e5ce698502.yAxis[0].axisLabel.formatter = "{value}"
            option_569658cffb59492e893aa8e5ce698502.dataZoom.end = 100
            option_569658cffb59492e893aa8e5ce698502.title[0].text = "·岗位分布"

            chart_569658cffb59492e893aa8e5ce698502.setOption(option_569658cffb59492e893aa8e5ce698502);
            window.addEventListener('resize', function () {
                chart_569658cffb59492e893aa8e5ce698502.resize();
            })
        })
        .catch(function (error) { // 请求失败处理
            console.log(error);
        })
}